package com.gitee.wsl.mathematics.geometry.shape

import kotlin.math.pow

open class Circle(var position: Point,
                  var radius: Float) {

    constructor(x:Float,y:Float,radius: Float =0.0f):this(Point(x,y),radius)

    val centerX:Float get() = position.x
    val centerY:Float get() = position.y

    fun contains(x:Float,y:Float): Boolean {
        return (x - centerX).pow(2) + (y - centerY).pow(2) <= radius*radius
    }

}

interface CircleEntry{
    val circle:Circle
}